import {GroupField} from "../../pages/customize/group";
import {CustomizeFields} from "../../pages/customize/service";

export const CHANGE_CUSTOMIZE = "change_customize"

export const CHANGE_GROUP = "change_group"

interface ChangeCustomizeAction {
    type: typeof CHANGE_CUSTOMIZE;
    payload: CustomizeFields
}

interface ChangeGroupAction {
    type: typeof CHANGE_GROUP;
    payload: GroupField
}

export type CustomizeActionTypes = ChangeCustomizeAction | ChangeGroupAction;

export const changeCustomizeActionCreator = (data: CustomizeFields): ChangeCustomizeAction => {
  return {
      type: CHANGE_CUSTOMIZE,
      payload: data
  }
}

export const addGroupActionCreator = (data: GroupField): ChangeGroupAction => {
    return {
        type: CHANGE_GROUP,
        payload: data
    }
}

